class Solution:
    def read(self, buf, n):
        """
        :type buf: Destination buffer (List[str])
        :type n: Number of characters to read (int)
        :rtype: The number of actual characters read (int)
        """
        index = 0
        count = 0
        while n >= 0:
            temp_buf=[' ']*4
            now_read = read4(temp_buf)
            for i in range(min(n,now_read)):
                buf[index + i] = temp_buf[i]
            count += min(n, now_read)
            index += 4
            n = n - 4
            if now_read < 4 or n <= 0:
                break
        return count
